# def stu_info(name, age, gender="男"):
#     print(f"{name}的年龄是: {age}, 性别是: {gender}")


# def sum_numbera(*args):
#     result = 0
#     for i in args:
#         result += i
#         return f"累加的结果是: {result}"
#
#
# aa = sum_numbera(1, 2, 3, 4, 5, 6)
# print(aa)


# def sum_numbera(*args):
#     """
#     累计求和返回结果
#     :param args:
#     :return:
#     """
#     result = 0
#     for i in args:
#         result += i
#         return result


def demo(a, b):
    result = a + b
    return result
    print(demo(10, 20))


user_list = [
    {'name': '张三', 'age': 22, 'title': '测试工程师'},
    {'name': '李四', 'age': 24, 'title': '开发工程师'},
    {'name': '王五', 'age': 21, 'title': '测试工程师'}
]
keys = lambda x: x.get("age")
user_list.sort(key=keys)
print(user_list)
user_list.sort(key=keys, reverse=True)
print(user_list)